<template>
  <div class="bocenter">
    <div class="t-title">
      <span>今日告警</span>
    </div>
    <div class="t-content row-flex">
      <div class="top-row sp-flex">
        <div class="small-warning">
          <h1>{{ alarmObj.alarHostNum }}</h1>
          <p>告警终端</p>
        </div>
        <div class="small-warning">
          <h1>{{ alarmObj.keywordNum }}</h1>
          <p>标密终端</p>
        </div>
      </div>
      <!-- 中间部分 -->
      <div class="center-row">
        <div>
          <span style="color: #ff3535">违规文件</span>
          <div class="small-warning">
            <h1 class="mono">{{ alarmObj.violationAlarmNumToday }}</h1>
          </div>
          <span
            >较昨日
            <img
            class="imgicon"
              :src="
                alarmObj.violationYesterday.indexOf('上升') == -1
                  ? require('@/assets/images/main/down@2x.png')
                  : require('@/assets/images/main/up@2x.png')
              "
              alt=""
            />
            {{  alarmObj.violationYesterday}}
          </span>
        </div>
        <div>
          <span style="color: #FACC29">告警文件</span>
          <div class="small-warning">
            <h1 class="mono orange">{{ alarmObj.totalAlarmNumToday }}</h1>
          </div>
          <span
            >较昨日
            <img
            class="imgicon"
              :src="
                alarmObj.alarmYesterday.indexOf('上升') == -1
                  ? require('@/assets/images/main/down@2x.png')
                  : require('@/assets/images/main/up@2x.png')
              "
              alt=""
            />
            {{  alarmObj.alarmYesterday}}
          </span>
        </div>
      </div>
      <div class="bottom-row sp-flex">
        <div class="small-warning">
          <h1>{{ alarmObj.violationHostNum }}</h1>
          <p>违规终端</p>
        </div>
        <div class="small-warning">
          <h1>{{ alarmObj.densityNum }}</h1>
          <p>关键词终端</p>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    alarmObj: {
      type: Object,
      default: () => {},
    },
  },
};
</script>

<style lang="scss" scoped>
.bocenter {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  .t-title {
    height: 1.875rem;
    display: flex;
    justify-content: center;
    margin-bottom: 0.625rem;
    span {
      width: 12.5rem;
      display: flex;
      align-items: center;
      font-size: 1.375rem;
      justify-content: center;
      font-weight: 500;

      padding: 1.825rem 2.5rem 1.875rem;
      background: url(../../../../assets/images/main/tit-bg4@2x.png)
        no-repeat;
      background-size: 100% 100%;
    }
  }
  .t-content {
    flex: 1;
  }
  .small-warning {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    width: 12.5rem;
    height: 9.375rem;
    background: url(../../../../assets/images/main/icon-5.png) no-repeat
      center center;
    background-size: contain;
    h1 {
      font-size: 2.5rem;
      color: transparent;
      background: linear-gradient(to bottom, #ffffff, #d4f1ff, #3cc1ff);
      -webkit-background-clip: text;
      &.mono {
        font-family: "digital-7";
        font-size: 3.75rem;
        color: #ff3535;
        font-weight: 500;
        &.orange {
          color: #facc29;
        }
      }
    }
  
  }
  .top-row {
    margin-bottom: 3.125rem;
    width: 100%;
  }
  .imgicon{
        width: 1.25rem;
        vertical-align: middle;
    }
  .center-row {
    position: absolute;
    display: flex;
    justify-content: space-between;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -36%);
    height: 78%;
    width: 55%;
    padding: 0 4.375rem;
    background: url(../../../../assets/images/main/icon-6@2x.png) no-repeat center center;
    background-size: contain;
    .small-warning {
      margin: 1.875rem 0 -0.3125rem;
    }
  }
  .bottom-row {
    width: 100%;
    padding: 0 4.375rem;
  }
}
</style>